/**
 * Copyright(c) 2013 Jade Techonologies Co., Ltd.
 *
 * History:
 *   14-7-29 下午1:35 Created by dwzhang
 */
package com.jade.framework.base.comm;

/**
 * 消息请求发送的异步响应。
 *
 * @author dwzhang
 * @version 1.0 14-7-29 下午1:35
 */
public interface ResponseFuture
{
    /**
     * get result.
     *
     * @return result.
     */
    ResponseMessage get()
            throws CommException;

    /**
     * get result with the specified timeout.
     *
     * @param timeoutInMillis timeout.
     * @return result.
     */
    ResponseMessage get(int timeoutInMillis)
            throws CommException, InterruptedException;

    /**
     * set callback.
     *
     * @param callback 响应回调消息。
     */
    void setCallback(ResponseCallback callback);

    /**
     * check is done.
     *
     * @return done or not.
     */
    boolean isDone();
}
